<template>
    <!-- 分类导航 -->
    <div class="type-nav">
        <el-menu :default-active="activeCode" mode="horizontal">
           <el-menu-item :index="item.code" v-for="(item,index) in typeitem" :key="index" @click="typeItemClick(item.code)">
                {{item.type}}
           </el-menu-item>
        </el-menu>
    </div>
</template>
<script>
export default {
    name:'',
    props:{
        typeitem:{
            type:Array,
            default(){
                return []
            }
        }
    },
    data() {
        return {
            activeCode:this.typeitem[0].code
        }
    },
    methods:{
        typeItemClick(code){
            this.$emit('typeItemClick',code)
        }
    },
    created(){
        
    },
}
</script>
<style lang="less" scoped>
    .type-nav{
        .el-menu-item {
            color: #303133;
            height: 30px;
            line-height: 30px;
            padding: 0 8px;
	    }
    }
</style>